-
Notifications
You must be signed in to change notification settings - Fork 96
chore: enable typescript-eslint/explicit-function-return-type #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables the TypeScript ESLint rule @typescript-eslint/explicit-function-return-type
to enforce explicit return type annotations on functions throughout the codebase. The change improves code clarity and type safety by requiring developers to explicitly declare what their functions return.
- Enable the ESLint rule for explicit function return types
- Add explicit return type annotations to functions across test files and source code
- Add ESLint disable comments for auto-generated API client methods
Reviewed Changes
Copilot reviewed 35 out of 36 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
eslint.config.js | Enables the @typescript-eslint/explicit-function-return-type ESLint rule |
tests/unit/transports/stdio.test.ts | Adds : void return type to callback function |
tests/unit/telemetry.test.ts | Adds : void return type to test helper function |
tests/integration/tools/mongodb/mongodbHelpers.ts | Adds return types to helper functions and test utilities |
tests/integration/tools/mongodb/metadata/logs.test.ts | Adds : void return type to validation function |
tests/integration/tools/mongodb/metadata/listDatabases.test.ts | Adds : void return type to validation function |
tests/integration/tools/mongodb/delete/deleteMany.test.ts | Adds : Promise<void> return types to async helper functions |
tests/integration/tools/mongodb/create/insertMany.test.ts | Adds : Promise<void> return type to validation function |
tests/integration/tools/mongodb/create/createIndex.test.ts | Adds : Promise<void> return type to validation function |
tests/integration/tools/atlas/clusters.test.ts | Adds return types to utility functions |
tests/integration/tools/atlas/atlasHelpers.ts | Adds return types to test helper functions |
tests/integration/tools/atlas/accessLists.test.ts | Adds : string return type to helper function |
tests/integration/inMemoryTransport.ts | Adds : void return types to stream handlers |
tests/integration/helpers.ts | Adds return types to getter functions |
tests/integration/fixtures/httpsServerProxyTest.ts | Adds : void return type to connection handler |
tests/integration/common/connectionManager.test.ts | Adds return type to helper function |
tests/integration/common/apiClient.test.ts | Adds : void return type to test helper |
tests/accuracy/sdk/models.ts | Adds : LanguageModelV1 return types to model getter methods |
tests/accuracy/sdk/describeAccuracyTests.ts | Adds : void return type to describe function |
tests/accuracy/sdk/agent.ts | Adds return type to agent prompt method |
src/transports/streamableHttp.ts | Adds return types to request handlers and callbacks |
src/tools/tool.ts | Adds : void return type to update function |
src/tools/atlas/read/listDBUsers.ts | Adds : string return types to formatting functions |
src/telemetry/telemetry.ts | Adds : Promise<string> return type to machine ID function |
src/server.ts | Adds : void return types to server event handlers and registration methods |
src/resources/resource.ts | Adds : Promise<void> return type and ESLint disable comment |
src/index.ts | Adds : Promise<void> return types to main and shutdown functions |
src/common/session.ts | Adds : void return type to agent runner setter |
src/common/managedTimeout.ts | Adds : void return types to timeout control functions |
src/common/config.ts | Adds : Partial<UserConfig> return type to CLI config parser |
src/common/atlas/apiClient.ts | Adds return type to access token method and ESLint disable comments for auto-generated methods |
src/common/atlas/accessListUtils.ts | Adds return type to access list entry function |
scripts/filter.ts | Adds : Promise<string> and : Promise<void> return types to script functions |
scripts/apply.ts | Adds : Promise<void> return type and ESLint disable comment for generated code |
scripts/accuracy/generateTestSummary.ts | Adds return types to helper functions and defines missing interface |
Pull Request Test Coverage Report for Build 16804813849Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I feel like it should be fine to be lenient for tests but no strong opinion.
Proposed changes
Checklist